package com.changgou.user.feign;

import com.changgou.user.pojo.User;
import com.changgou.util.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/*****
 * @Author: 黑马训练营
 * @Description: com.changgou.user.feign
 ****/
@FeignClient(value = "user")
@RequestMapping(value = "/user")
public interface UserFeign {

    /***
     * 根据ID查询User数据
     * @param id
     * @return
     */
    @GetMapping(value = "/load/{id}")
    Result<User> findById(@PathVariable String id);

    /***
     * 用户积分增加
     */
    @GetMapping(value = "/points/add")
    Result addUserPoints(@RequestParam(value = "points") Integer points);
}
